﻿using Forum.Model.QueryFilters;

namespace Forum.Model.Request
{
    public class PostReq
    {
        /// <summary>
        /// 标题
        /// </summary>
        public string? Title { get; set; }

        /// <summary>
        /// 梗概
        /// </summary>
        public string? Summary { get; set; }

        /// <summary>
        /// 内容（markdown格式）
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        public int CategoryId { get; set; }
    }

    /// <summary>
    /// 博客文章请求参数
    /// </summary>
    public class PostQueryParameters : QueryParameters
    {
        /// <summary>
        /// 文章状态
        /// </summary>
        public int? Status { get; set; }
        /// <summary>
        /// 分类ID
        /// </summary>
        public int CategoryId { get; set; } = 0;
        /// <summary>
        /// 排序字段
        /// </summary>
        public new string? SortBy { get; set; } = "-LastUpdateTime";
    }

    public class PostUpdateReq
    {
        public string Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 梗概
        /// </summary>
        public string Summary { get; set; }

        /// <summary>
        /// 内容（markdown格式）
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        public int CategoryId { get; set; }
    }
}
